/**
 * @file pdtmanagement/pdtfunds.js
 *  产品管理/查看资金
 * @author
 */
import React, {Component,PropTypes} from 'react';
import {connect} from 'dva';
import {routerRedux,withRouter } from 'dva/router';
import { Button,Row,Col,Table,Icon,Pagination,DatePicker,Form,Breadcrumb} from 'antd';
import moment from 'moment';

import {Tablelist} from '../../../components';

const PdtFunds = ({dispatch,pdtfunds,location,
})=>{
	if(pdtfunds.status){
		const {fundslist,page,} = pdtfunds;
		const columns = [
			{
				title: '日期',
				dataIndex: 'date',
				key: 'date',
				width: 100,
			},
			{
				title: '流入',
				dataIndex: 'inValue',
				key: 'inValue',
				width: 100,
			},
			{
				title: '流出',
				dataIndex: 'outValue',
				key: 'outValue',
				width: 100,
			},
			{
				title: '可用现金',
				dataIndex: 'availableCash',
				key: 'availableCash',
				width: 100,
			},
		]


		// 改变数据显示条数
		// function onShowSizeChange(current, pageSize) {
		// 	const querys = location.query
		// 	const pagesize = pdtfunds.pageSize
		// 	dispatch({
		// 		type:'pdtfunds/changeState',
		// 		payload:{
		// 			...querys,
		// 			pagesize:pageSize,
		// 			currentpage:1
		// 		}
		// 	})
		// }
		// //改变当前页
		// function onChangecurrentpage(current){
		// 	const querys = location.query
		// 	const currentpage = pdtfunds.currentpage
		// 	const pagesize = page.pagesize
		// 	dispatch({
		// 		type:'pdtfunds/changeState',
		// 		payload:{
		// 			...querys,
		// 			pagesize:pagesize,
		// 			currentpage:current
		// 		}
		// 	})
		// }



		return(
			<div>
					<Table
						columns={columns}
						dataSource={fundslist}
						pagination={false}
						record={record => `${record.date}-${record.stackCode}-${record.tradeNumber}-${record.tradeType}`}
						scroll={{ y: 400 }}
						size="middle"
						style={{marginBottom:50}}
					/>
			</div>

			)
	}else{
		return null;
	}
}
PdtFunds.PropTypes = {};
export default connect(({pdtfunds})=>({pdtfunds}))(PdtFunds)
